<?php

namespace app\yyq\controller;

use app\admin\model\Activity;
use app\admin\model\ActivityType;
use app\admin\model\AppCase;
use app\admin\model\Banner;
use app\admin\model\Company;
use app\admin\model\Nav as NavModel;
use app\admin\model\Navs;
use app\admin\model\NewsCenter;
use app\admin\model\Partners;
use app\admin\model\RecommendBanner;
use app\admin\model\RecommendType;
use app\admin\model\Service;
use app\admin\model\Web;
use app\admin\model\Yyq;
use think\Controller;

class Index extends Controller
{

    public function index()
    {
        $where['state'] = 1;
        // 查询目的地图片
        $recommend_banner = RecommendBanner::where($where)->select();

        // 查询目的地
        $equip = \app\admin\model\Equip::where($where)->select();

        // 查询营友圈表
        $yyq = Yyq::where($where)->limit(0,2)->select();

        // 查询推荐表 这里建错表了recommend 是目的地上面的 和新闻咨询用一个
        $recommend = \app\admin\model\Recommend::where($where)->select();

        // 查询目的地分类
        $recommend_type = RecommendType::where($where)->select();
        // 查询热门活动
        $activity = Activity::where($where)->select();
        // 查询热门活动分类
        $activity_type = ActivityType::where($where)->limit(0, 5)->select();
        return view('index',$this->getCommonData()
            +[
                'activity' => $activity,
                'activity_type' => $activity_type,
                'recommend_type' => $recommend_type,
                'recommend' => $recommend,
                'yyq' => $yyq,
                'recommend_banner' =>  $recommend_banner,
                'equip' => $equip,
                ]
        );
    }


}